Const EVENT_SCINTILLA:Int = 99999

Type TScintillaTextArea Extends TProxyGadget
	Field _proxy:TGadget
	Field _scintilla:ScintillaAbstractDriver
	Field _scintillastyle:TScintillaStyle
	Field _locked:Int = 0
	
	Function Create:TScintillaTextArea(X:Int, Y:Int, w:Int, h:Int, parent:TGadget)
		Local scintillaarea:TScintillaTextArea = New TScintillaTextArea
		scintillaarea.Init(x , y , w , h , parent) 
		Return scintillaarea
	End Function
	
	Method Init(X:Int, Y:Int, w:Int, h:Int, parent:TGadget)
		_proxy = CreatePanel(X, Y, w, h, parent)
		SetProxy(_proxy)
		InitScintilla()
	End Method
	
	Method InitScintilla() 
		_scintilla = CreateDriver()
		
		If _scintilla <> Null Then
			_scintilla.Init(_proxy)
			_scintilla.SetNotfiyHandler(Self, TScintillaTextArea.NotifyHandler)
			_scintilla.SendEditor (SCI_SETMODEVENTMASK, SC_MODEVENTMASKALL)
		Else
			Throw "No Scintilla driver found."
		End If
	End Method
	
	Method GetScintilla:ScintillaAbstractDriver()
		Return _scintilla
	End Method
	
	Method DirectFunction:Int(MSG:Int, wp:Int = 0, lp:Int = 0)
		If _scintilla <> Null Then Return _scintilla.SendEditor(MSG, wp, lp)
	End Method
	
	Function NotifyHandler(area:Object, wp:Int, lp:Int)
		If area <> Null Then
			TScintillaTextArea(area).OnNotify(0, wp, lp)
		End If
	End Function
	
	Method OnNotify(cmd:Int, wp:Int, lp:Int)
		If _locked = 0 Then
			Local nmhdr:Int Ptr
			Local event:TEvent
			nmhdr = Int Ptr(lp)								
			Local notification:SCNotification = New SCNotification
			MemCopy Byte Ptr notification, nmhdr, SizeOf(notification)							
			Local L:TScintillaEventData = TScintillaEventData.From(notification)
			PostGuiEvent EVENT_SCINTILLA, Self, L.Code,,, , L
		End If
	End Method
	
	'#region TextArea
	Method CharCount:Int()
		Return _scintilla.SendEditor(SCI_GETTEXTLENGTH)
	EndMethod
	
	Method activate(command:Int)
		If _scintilla.IsNullDriver() Then Super.activate(command)
		Select command
			Case ACTIVATE_CUT	
				Cut()
			Case ACTIVATE_COPY	
				Copy()
			Case ACTIVATE_PASTE
				paste()
			Case ACTIVATE_PRINT
				DoPrint()		
			Default
				Super.activate(command)
		End Select
	End Method
	
	Method DoPrint()
		_scintilla.DoPrint()
	End Method

	Method setFont(font:TGuiFont)
			For Local I:Int = 0 To 99
				_scintilla.SendEditorString(SCI_STYLESETFONT , I , Font.name)
				STYLESETSIZE( I , Int(Font.Size) )
				STYLESETBOLD(I, (font.Style & FONT_BOLD) >0)
				STYLESETITALIC( I, (font.Style & FONT_ITALIC) >0)	
			Next
	End Method

	Method setText(text:String)
		If _scintilla.IsNullDriver() <> Null Then
			_scintilla.IsNullDriver().setText(text)
		Else
			LockText()
			_scintilla.SendEditorString(SCI_SETTEXT, 0, text)
			Setsavepoint()
			UnlockText()
		End If
	End Method
	
	Method ReplaceText(Pos:Int, Length:Int, text:String, units:Int)
		If _scintilla.IsNullDriver() <> Null Then
			_scintilla.IsNullDriver().ReplaceText(Pos, Length, text, units)
		Else
			If units = TEXTAREA_LINES
				Local n:Int=pos
				pos=CharAt(pos)
				If length>=0 length=CharAt(n+length)-pos
			EndIf			
			If length < 0 Then length = charcount() - pos	
			Print pos + ";"+ (pos + length)
			_scintilla.SendEditor(SCI_SETTARGETSTART , pos)
			_scintilla.SendEditor(SCI_SETTARGETEND , pos + Length)
			_scintilla.SendEditorString(SCI_REPLACETARGET, text.Length, text)
		End If
	End Method
	
	Method addText(text:String)
		If _scintilla.IsNullDriver() <> Null Then
			_scintilla.IsNullDriver().addText(text)
		Else
			_scintilla.SendEditorString(SCI_APPENDTEXT, text.Length, text)
		End If
	End Method
	
	Method AreaText:String(Pos:Int, Length:Int, units:Int)
		If _scintilla.IsNullDriver() <> Null Then Return _scintilla.IsNullDriver().AreaText(Pos, Length, units)
		
		Local Range:TEXTRANGE = New TEXTRANGE
		If Length < 0 Then Length = CharCount()
		
		If units = TEXTAREA_LINES Then
			Range.cpmin = CharAt(pos)
			Range.cpmax = CharAt(pos + Length+1)
		Else
			Range.cpmin = pos
			Range.cpmax = pos+Length
		End If
		
		Range.lpstrText = New Byte[2*(Range.cpmax - Range.cpmin)+2]	
		Local tmpLength:Int = _scintilla.SendEditor(SCI_GETTEXTRANGE, 0, Int Byte Ptr Range)
		Local text:String = String.FromCString(Byte Ptr(Range.lpstrText))
			
		Return text
	End Method
	
	Method AreaLen:Int(units:Int)
		If _scintilla.IsNullDriver() <> Null Then Return _scintilla.IsNullDriver().AreaLen(units)
		If units = TEXTAREA_CHARS Then
			Return Gettextlength()
		Else
			Return getLineCount()
		End If
	End Method
	
	Method LockText()
		If _scintilla.IsNullDriver() <> Null Then
			_scintilla.IsNullDriver().LockText()
		Else
			_locked = 1
		End If
	End Method
	
	Method UnlockText()
		If _scintilla.IsNullDriver() <> Null Then
			_scintilla.IsNullDriver().UnlockText()
		Else
			_locked = 0
		End If
	End Method
	
	Method SetTabs(tabs:Int)
		_scintilla.SendEditor(SCI_SETTABWIDTH,tabs)
	EndMethod

	Method SetTextColor(r:Int, g:Int, b:Int)
		If _scintilla.IsNullDriver() <> Null Then
			_scintilla.IsNullDriver().SetTextColor(r, g, b)
		Else
			Stylesetfore(STYLE_DEFAULT, r, g, b)
		End If
	EndMethod

	Method SetColor(r:Int,g:Int,b:Int)
		StyleSetBack(STYLE_DEFAULT, r, g, b)
		Stylesetback(STYLE_DEFAULT, r, g, b)
	EndMethod
	
	Method GetCursorPos:Int(units:Int)
		If _scintilla.IsNullDriver() <> Null Then Return _scintilla.IsNullDriver().GetCursorPos(units)
		Local Pos:Int = _scintilla.SendEditor(SCI_GETSELECTIONSTART)'_scintilla.SendEditor(SCI_GETCURRENTPOS)
		If units = TEXTAREA_LINES Then
			Return LineAT(pos)
		End If
		Return pos
	End Method
	
	Method getSelectionLength:Int(units:Int)
		If _scintilla.IsNullDriver() <> Null Then Return _scintilla.IsNullDriver().getSelectionLength(units)
		Local cpMin:Int = _scintilla.SendEditor(SCI_GETSELECTIONSTART)
		Local cpMax:Int = _scintilla.SendEditor(SCI_GETSELECTIONEND)
		If units=TEXTAREA_LINES 
			Return LineAt(cpMax)-LineAt(cpMin)
		Else
			Return cpMax-cpMin
		EndIf
	End Method
	
	Method SetStyle(r:Int, g:Int, b:Int, Flags:Int, Pos:Int, Length:Int, units:Int)
		If _scintilla.IsNullDriver() <> Null Then _scintilla.IsNullDriver().SetStyle(r, g, b, Flags, Pos, Length, units)
	End Method
	
	Method setSelection(Pos:Int, Length:Int, units:Int)
		If _scintilla.IsNullDriver() <> Null Then
			_scintilla.IsNullDriver().setSelection(Pos, Length, units)
		Else
			If units = TEXTAREA_LINES
				Local n:Int=pos
				pos=CharAt(pos)
				If length>=0 length=CharAt(n+length)-pos
			EndIf			
			If length < 0 Then length = charcount() - pos	
			' Desensitize()
			_scintilla.SendEditor(SCI_GOTOPOS,pos)
			_scintilla.SendEditor(SCI_SETSELECTIONSTART , pos)
			_scintilla.SendEditor(SCI_SETSELECTIONEND , pos + length)
			'Sensitize()
		End If
	End Method
	
	Method CharX:Int(char:Int)
		If _scintilla.IsNullDriver() <> Null Then Return _scintilla.IsNullDriver().CharX(char)
		Return _scintilla.SendEditor(SCI_POINTXFROMPOSITION, 0, char)
	EndMethod
	
	Method CharY:Int(char:Int)
		If _scintilla.IsNullDriver() <> Null Then Return _scintilla.IsNullDriver().CharY(char)
		Return _scintilla.SendEditor(SCI_POINTYFROMPOSITION, 0, char)
	EndMethod
	
	Method CharAt:Int(Line:Int)
		If _scintilla.IsNullDriver() <> Null Then Return _scintilla.IsNullDriver().CharAt(Line)
		Return _scintilla.SendEditor(SCI_POSITIONFROMLINE, Line, 0)
	End Method
	
	Method LineAt:Int(index:Int)
		If _scintilla.IsNullDriver() <> Null Then Return _scintilla.IsNullDriver().LineAt(index)
		Return _scintilla.SendEditor(SCI_LINEFROMPOSITION, index, 0)
	End Method
	
	'Scintilla Temp
	
	Method SetLineNumbering(Margin:Int = 0, State:Int = 0)
		_scintilla.SendEditor(SCI_SETMARGINTYPEN , Margin , SC_MARGIN_NUMBER)
		If State = True Then
			_scintilla.SendEditor(SCI_SETMARGINWIDTHN , Margin , _scintilla.SendEditorString(SCI_TEXTWIDTH , 0 , "_99999") )
			'numbers= True
		Else
			_scintilla.SendEditor(SCI_SETMARGINWIDTHN , Margin , 0 )
			'numbers = False
		End If
	End Method

	'#endregion	
	
	'#region Scintilla Autogenerated
	
	Method Addselection:Int(caret:Int, anchor:Int)
		Local result:Int = DirectFunction(SCI_ADDSELECTION,caret,anchor)
		Return Result
	End Method
	
	Method scnAddtext:Int(Length:Int, s:String)
		Local s_ptr:Byte Ptr = s.toCString()
		Local Result:Int = DirectFunction(SCI_ADDTEXT, Length, Int(s_ptr))
		MemFree(s_ptr)
		Return result
	End Method
	
	Method Addundoaction:Int(token:Int,flags:Int)
		Local result:Int = DirectFunction(SCI_ADDUNDOACTION,token,flags)
		Return result
	End Method
	
	Method Allocate:Int(bytes:Int)
		Local result:Int = DirectFunction(SCI_ALLOCATE,bytes,0)
		Return result
	End Method
	
	Method Annotationclearall:Int()
		Local result:Int = DirectFunction(SCI_ANNOTATIONCLEARALL)
		Return result
	End Method
	
	Method Annotationgetlines:Int(line:Int)
		Local result:Int = DirectFunction(SCI_ANNOTATIONGETLINES,line)
		Return result
	End Method
	
	Method Annotationgetstyle:Int(line:Int)
		Local result:Int = DirectFunction(SCI_ANNOTATIONGETSTYLE,line)
		Return result
	End Method
	
	Method Annotationgetstyleoffset:Int()
		Local result:Int = DirectFunction(SCI_ANNOTATIONGETSTYLEOFFSET)
		Return result
	End Method
	
	Method Annotationgetstyles:String(Line:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_ANNOTATIONGETSTYLES,line,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Annotationgettext:String(Line:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_ANNOTATIONGETTEXT,line,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Annotationgetvisible:Int()
		Local result:Int = DirectFunction(SCI_ANNOTATIONGETVISIBLE)
		Return result
	End Method
	
	Method Annotationsetstyle:Int(line:Int,style:Int)
		Local result:Int = DirectFunction(SCI_ANNOTATIONSETSTYLE,line,style)
		Return result
	End Method
	
	Method Annotationsetstyleoffset:Int(style:Int)
		Local result:Int = DirectFunction(SCI_ANNOTATIONSETSTYLEOFFSET,style)
		Return result
	End Method
	
	Method Annotationsetstyles:String(Line:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_ANNOTATIONSETSTYLES,line,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Annotationsettext:String(Line:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_ANNOTATIONSETTEXT,line,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Annotationsetvisible:Int(visible:Int)
		Local result:Int = DirectFunction(SCI_ANNOTATIONSETVISIBLE,visible)
		Return result
	End Method
	
	Method Appendtext:Int(length:Int,s:String)
		Local s_ptr:Byte Ptr = s.toCString()
		Local Result:Int = DirectFunction(SCI_APPENDTEXT, Length, Int(s_ptr))
		MemFree(s_ptr)
		Return result
	End Method
	
	Method Assigncmdkey:Int(keyDefinition:Int,sciCommand:Int)
		Local result:Int = DirectFunction(SCI_ASSIGNCMDKEY,keyDefinition,sciCommand)
		Return result
	End Method
	
	Method Autocactive:Int()
		Local result:Int = DirectFunction(SCI_AUTOCACTIVE)
		Return result
	End Method
	
	Method Autoccancel:Int()
		Local result:Int = DirectFunction(SCI_AUTOCCANCEL)
		Return result
	End Method
	
	Method Autoccomplete:Int()
		Local result:Int = DirectFunction(SCI_AUTOCCOMPLETE)
		Return result
	End Method
	
	Method Autocgetautohide:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETAUTOHIDE)
		Return result
	End Method
	
	Method Autocgetcancelatstart:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETCANCELATSTART)
		Return result
	End Method
	
	Method Autocgetcaseinsensitivebehaviour:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETCASEINSENSITIVEBEHAVIOUR)
		Return result
	End Method
	
	Method Autocgetchoosesingle:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETCHOOSESINGLE)
		Return result
	End Method
	
	Method Autocgetcurrent:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETCURRENT)
		Return result
	End Method
	
	Method Autocgetcurrenttext:String(Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_AUTOCGETCURRENTTEXT,0,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Autocgetdroprestofword:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETDROPRESTOFWORD)
		Return result
	End Method
	
	Method Autocgetignorecase:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETIGNORECASE)
		Return result
	End Method
	
	Method Autocgetmaxheight:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETMAXHEIGHT)
		Return result
	End Method
	
	Method Autocgetmaxwidth:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETMAXWIDTH)
		Return result
	End Method
	
	Method Autocgetseparator:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETSEPARATOR)
		Return result
	End Method
	
	Method Autocgettypeseparator:Int()
		Local result:Int = DirectFunction(SCI_AUTOCGETTYPESEPARATOR)
		Return result
	End Method
	
	Method Autocposstart:Int()
		Local result:Int = DirectFunction(SCI_AUTOCPOSSTART)
		Return result
	End Method
	
	Method Autocselect:Int(_select:String)
		Local select_ptr:Byte Ptr = _select.toCString()
		Local Result:Int = DirectFunction(SCI_AUTOCSELECT, 0, Int(select_ptr))
		MemFree(select_ptr)
		Return result
	End Method
	
	Method Autocsetautohide:Int(autoHide:Int)
		Local result:Int = DirectFunction(SCI_AUTOCSETAUTOHIDE,autoHide)
		Return result
	End Method
	
	Method Autocsetcancelatstart:Int(cancel:Int)
		Local result:Int = DirectFunction(SCI_AUTOCSETCANCELATSTART,cancel)
		Return result
	End Method
	
	Method Autocsetcaseinsensitivebehaviour:Int(behaviour:Int)
		Local result:Int = DirectFunction(SCI_AUTOCSETCASEINSENSITIVEBEHAVIOUR,behaviour)
		Return result
	End Method
	
	Method Autocsetchoosesingle:Int(chooseSingle:Int)
		Local result:Int = DirectFunction(SCI_AUTOCSETCHOOSESINGLE,chooseSingle)
		Return result
	End Method
	
	Method Autocsetdroprestofword:Int(dropRestOfWord:Int)
		Local result:Int = DirectFunction(SCI_AUTOCSETDROPRESTOFWORD,dropRestOfWord)
		Return result
	End Method
	
	Method Autocsetfillups:Int(chars:String)
		Local chars_ptr:Byte Ptr = chars.toCString()
		Local Result:Int = DirectFunction(SCI_AUTOCSETFILLUPS, 0, Int(chars_ptr))
		MemFree(chars_ptr)
		Return result
	End Method
	
	Method Autocsetignorecase:Int(ignoreCase:Int)
		Local result:Int = DirectFunction(SCI_AUTOCSETIGNORECASE,ignoreCase)
		Return result
	End Method
	
	Method Autocsetmaxheight:Int(rowCount:Int)
		Local result:Int = DirectFunction(SCI_AUTOCSETMAXHEIGHT,rowCount)
		Return result
	End Method
	
	Method Autocsetmaxwidth:Int(characterCount:Int)
		Local result:Int = DirectFunction(SCI_AUTOCSETMAXWIDTH,characterCount)
		Return result
	End Method
	
	Method Autocsetseparator:Int()
		Local result:Int = DirectFunction(SCI_AUTOCSETSEPARATOR,0)
		Return result
	End Method
	
	Method Autocsettypeseparator:Int(chars:String)
		Local chars_ptr:Byte Ptr = chars.toCString()
		Local Result:Int = DirectFunction(SCI_AUTOCSETTYPESEPARATOR, Int(chars_ptr))
		Return Result
	End Method
	
	Method Autocshow:Int(lenEntered:Int,list:String)
		Local list_ptr:Byte Ptr = list.toCString()
		Local Result:Int = DirectFunction(SCI_AUTOCSHOW, lenEntered, Int(list_ptr))
		MemFree(list_ptr)
		Return result
	End Method
	
	Method Autocstops:Int(chars:String)
		Local chars_ptr:Byte Ptr = chars.toCString()
		Local Result:Int = DirectFunction(SCI_AUTOCSTOPS, 0, Int(chars_ptr))
		MemFree(chars_ptr)
		Return result
	End Method
	
	Method Beginundoaction:Int()
		Local result:Int = DirectFunction(SCI_BEGINUNDOACTION)
		Return result
	End Method
	
	Method Bracebadlight:Int(pos1:Int)
		Local result:Int = DirectFunction(SCI_BRACEBADLIGHT,pos1)
		Return result
	End Method
	
	Method Bracebadlightindicator:Int(useBraceBadLightIndicator:Int,indicatorNumber:Int)
		Local result:Int = DirectFunction(SCI_BRACEBADLIGHTINDICATOR,useBraceBadLightIndicator,indicatorNumber)
		Return result
	End Method
	
	Method Bracehighlight:Int(pos1:Int,pos2:Int)
		Local result:Int = DirectFunction(SCI_BRACEHIGHLIGHT,pos1,pos2)
		Return result
	End Method
	
	Method Bracehighlightindicator:Int(useBraceHighlightIndicator:Int,indicatorNumber:Int)
		Local result:Int = DirectFunction(SCI_BRACEHIGHLIGHTINDICATOR,useBraceHighlightIndicator,indicatorNumber)
		Return result
	End Method
	
	Method Bracematch:Int(position:Int,maxReStyle:Int)
		Local result:Int = DirectFunction(SCI_BRACEMATCH,position,maxReStyle)
		Return result
	End Method
	
	Method Calltipactive:Int()
		Local result:Int = DirectFunction(SCI_CALLTIPACTIVE)
		Return result
	End Method
	
	Method Calltipcancel:Int()
		Local result:Int = DirectFunction(SCI_CALLTIPCANCEL)
		Return result
	End Method
	
	Method Calltipposstart:Int()
		Local result:Int = DirectFunction(SCI_CALLTIPPOSSTART)
		Return result
	End Method
	
	Method Calltipsetback:Int(r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_CALLTIPSETBACK,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Calltipsetfore:Int(r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_CALLTIPSETFORE,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Calltipsetforehlt:Int(r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_CALLTIPSETFOREHLT,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Calltipsethlt:Int(highlightStart:Int,highlightEnd:Int)
		Local result:Int = DirectFunction(SCI_CALLTIPSETHLT,highlightStart,highlightEnd)
		Return result
	End Method
	
	Method Calltipsetposition:Int(above:Int)
		Local Result:Int = DirectFunction(SCI_CALLTIPSETPOSITION, above)
		Return result
	End Method
	
	Method Calltipshow:Int(posStart:Int,definition:String)
		Local definition_ptr:Byte Ptr = definition.toCString()
		Local Result:Int = DirectFunction(SCI_CALLTIPSHOW, posStart, Int(definition_ptr))
		MemFree(definition_ptr)
		Return result
	End Method
	
	Method Calltipusestyle:Int(tabsize:Int)
		Local result:Int = DirectFunction(SCI_CALLTIPUSESTYLE,tabsize)
		Return result
	End Method
	
	Method Canpaste:Int()
		Local result:Int = DirectFunction(SCI_CANPASTE)
		Return result
	End Method
	
	Method Canredo:Int()
		Local result:Int = DirectFunction(SCI_CANREDO)
		Return result
	End Method
	
	Method Canundo:Int()
		Local result:Int = DirectFunction(SCI_CANUNDO)
		Return result
	End Method
	
	Method Changelexerstate:Int(Start:Int, _end:Int)
		Local Result:Int = DirectFunction(SCI_CHANGELEXERSTATE, Start, _end)
		Return result
	End Method
	
	Method Charpositionfrompoint:Int(x:Int,y:Int)
		Local result:Int = DirectFunction(SCI_CHARPOSITIONFROMPOINT,x,y)
		Return result
	End Method
	
	Method Charpositionfrompointclose:Int(x:Int,y:Int)
		Local result:Int = DirectFunction(SCI_CHARPOSITIONFROMPOINTCLOSE,x,y)
		Return result
	End Method
	
	Method Choosecaretx:Int()
		Local result:Int = DirectFunction(SCI_CHOOSECARETX)
		Return result
	End Method
	
	Method Clear:Int()
		Local result:Int = DirectFunction(SCI_CLEAR)
		Return result
	End Method
	
	Method Clearall:Int()
		Local result:Int = DirectFunction(SCI_CLEARALL)
		Return result
	End Method
	
	Method Clearallcmdkeys:Int()
		Local result:Int = DirectFunction(SCI_CLEARALLCMDKEYS)
		Return result
	End Method
	
	Method Clearcmdkey:Int(keyDefinition:Int)
		Local result:Int = DirectFunction(SCI_CLEARCMDKEY,keyDefinition)
		Return result
	End Method
	
	Method Cleardocumentstyle:Int()
		Local result:Int = DirectFunction(SCI_CLEARDOCUMENTSTYLE)
		Return result
	End Method
	
	Method Clearregisteredimages:Int()
		Local result:Int = DirectFunction(SCI_CLEARREGISTEREDIMAGES)
		Return result
	End Method
	
	Method Clearselections:Int()
		Local result:Int = DirectFunction(SCI_CLEARSELECTIONS)
		Return result
	End Method
	
	Method Colourise:Int(Start:Int, _end:Int)
		Local Result:Int = DirectFunction(SCI_COLOURISE, Start, _end)
		Return result
	End Method
	
	Method Contractedfoldnext:Int(lineStart:Int)
		Local result:Int = DirectFunction(SCI_CONTRACTEDFOLDNEXT,lineStart)
		Return result
	End Method
	
	Method Converteols:Int(eolMode:Int)
		Local result:Int = DirectFunction(SCI_CONVERTEOLS,eolMode)
		Return result
	End Method
	
	Method Copy:Int()
		Local result:Int = DirectFunction(SCI_COPY)
		Return result
	End Method
	
	Method Copyallowline:Int()
		Local result:Int = DirectFunction(SCI_COPYALLOWLINE)
		Return result
	End Method
	
	Method Copyrange:Int(Start:Int, _end:Int)
		Local Result:Int = DirectFunction(SCI_COPYRANGE, Start, _end)
		Return result
	End Method
	
	Method Copytext:Int(length:Int,text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_COPYTEXT, Length, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Countcharacters:Int(startPos:Int,endPos:Int)
		Local result:Int = DirectFunction(SCI_COUNTCHARACTERS,startPos,endPos)
		Return result
	End Method
	
	Method Createdocument:Int()
		Local result:Int = DirectFunction(SCI_CREATEDOCUMENT)
		Return result
	End Method
	
	Method Cut:Int()
		Local result:Int = DirectFunction(SCI_CUT)
		Return result
	End Method
	
	Method Deleterange:Int(pos:Int,deleteLength:Int)
		Local result:Int = DirectFunction(SCI_DELETERANGE,pos,deleteLength)
		Return result
	End Method
	
	Method Describekeywordsets:String(Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_DESCRIBEKEYWORDSETS,0,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Describeproperty:String(name:String, Length:Int)
		Local name_ptr:Byte Ptr = name.toCString()
		Local chars:Byte[] = New Byte[length]
		Local Result:Int = DirectFunction(SCI_DESCRIBEPROPERTY, Int(name_ptr), Int Byte Ptr(chars))
		MemFree(name_ptr)
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Doclinefromvisible:Int(displayLine:Int)
		Local result:Int = DirectFunction(SCI_DOCLINEFROMVISIBLE,displayLine)
		Return result
	End Method
	
	Method Emptyundobuffer:Int()
		Local result:Int = DirectFunction(SCI_EMPTYUNDOBUFFER)
		Return result
	End Method
	
	Method Encodedfromutf8:String(UTF8:String, Length:Int)
		Local utf8_ptr:Byte Ptr = utf8.toCString()
		Local chars:Byte[] = New Byte[length]
		Local Result:Int = DirectFunction(SCI_ENCODEDFROMUTF8, Int(utf8_ptr), Int Byte Ptr(chars))
		MemFree(utf8_ptr)
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Endundoaction:Int()
		Local result:Int = DirectFunction(SCI_ENDUNDOACTION)
		Return result
	End Method
	
	Method Ensurevisible:Int(line:Int)
		Local result:Int = DirectFunction(SCI_ENSUREVISIBLE,line)
		Return result
	End Method
	
	Method Ensurevisibleenforcepolicy:Int(line:Int)
		Local result:Int = DirectFunction(SCI_ENSUREVISIBLEENFORCEPOLICY,line)
		Return result
	End Method
	
	Method Findcolumn:Int(line:Int,column:Int)
		Local result:Int = DirectFunction(SCI_FINDCOLUMN,line,column)
		Return result
	End Method
	
	Method Getadditionalcaretfore:Int()
		Local result:Int = DirectFunction(SCI_GETADDITIONALCARETFORE)
		Return result
	End Method
	
	Method Getadditionalcaretsblink:Int()
		Local result:Int = DirectFunction(SCI_GETADDITIONALCARETSBLINK)
		Return result
	End Method
	
	Method Getadditionalcaretsvisible:Int()
		Local result:Int = DirectFunction(SCI_GETADDITIONALCARETSVISIBLE)
		Return result
	End Method
	
	Method Getadditionalselalpha:Int()
		Local result:Int = DirectFunction(SCI_GETADDITIONALSELALPHA)
		Return result
	End Method
	
	Method Getadditionalselectiontyping:Int()
		Local result:Int = DirectFunction(SCI_GETADDITIONALSELECTIONTYPING)
		Return result
	End Method
	
	Method Getalllinesvisible:Int()
		Local result:Int = DirectFunction(SCI_GETALLLINESVISIBLE)
		Return result
	End Method
	
	Method Getanchor:Int()
		Local result:Int = DirectFunction(SCI_GETANCHOR)
		Return result
	End Method
	
	Method Getbackspaceunindents:Int()
		Local result:Int = DirectFunction(SCI_GETBACKSPACEUNINDENTS)
		Return result
	End Method
	
	Method Getbuffereddraw:Int()
		Local result:Int = DirectFunction(SCI_GETBUFFEREDDRAW)
		Return result
	End Method
	
	Method Getcaretfore:Int()
		Local result:Int = DirectFunction(SCI_GETCARETFORE)
		Return result
	End Method
	
	Method Getcaretlineback:Int()
		Local result:Int = DirectFunction(SCI_GETCARETLINEBACK)
		Return result
	End Method
	
	Method Getcaretlinebackalpha:Int()
		Local result:Int = DirectFunction(SCI_GETCARETLINEBACKALPHA)
		Return result
	End Method
	
	Method Getcaretlinevisible:Int()
		Local result:Int = DirectFunction(SCI_GETCARETLINEVISIBLE)
		Return result
	End Method
	
	Method Getcaretperiod:Int()
		Local result:Int = DirectFunction(SCI_GETCARETPERIOD)
		Return result
	End Method
	
	Method Getcaretsticky:Int()
		Local result:Int = DirectFunction(SCI_GETCARETSTICKY)
		Return result
	End Method
	
	Method Getcaretstyle:Int()
		Local result:Int = DirectFunction(SCI_GETCARETSTYLE)
		Return result
	End Method
	
	Method Getcaretwidth:Int()
		Local result:Int = DirectFunction(SCI_GETCARETWIDTH)
		Return result
	End Method
	
	Method Getcharacterpointer:Int()
		Local result:Int = DirectFunction(SCI_GETCHARACTERPOINTER)
		Return result
	End Method
	
	Method Getcharat:Int(position:Int)
		Local result:Int = DirectFunction(SCI_GETCHARAT,position)
		Return result
	End Method
	
	Method Getcodepage:Int()
		Local result:Int = DirectFunction(SCI_GETCODEPAGE)
		Return result
	End Method
	
	Method Getcolumn:Int(position:Int)
		Local result:Int = DirectFunction(SCI_GETCOLUMN,position)
		Return result
	End Method
	
	Method Getcontrolcharsymbol:Int()
		Local result:Int = DirectFunction(SCI_GETCONTROLCHARSYMBOL)
		Return result
	End Method
	
	Method Getcurline:String(textLen:Int)
		Local chars:Byte[] = New Byte[TextLen]
		Local result:Int = DirectFunction(SCI_GETCURLINE,textLen,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Getcurrentpos:Int()
		Local result:Int = DirectFunction(SCI_GETCURRENTPOS)
		Return result
	End Method
	
	Method Getdirectfunction:Int()
		Local result:Int = DirectFunction(SCI_GETDIRECTFUNCTION)
		Return result
	End Method
	
	Method Getdirectpointer:Int()
		Local result:Int = DirectFunction(SCI_GETDIRECTPOINTER)
		Return result
	End Method
	
	Method Getdocpointer:Int()
		Local result:Int = DirectFunction(SCI_GETDOCPOINTER)
		Return result
	End Method
	
	Method Getedgecolour:Int()
		Local result:Int = DirectFunction(SCI_GETEDGECOLOUR)
		Return result
	End Method
	
	Method Getedgecolumn:Int()
		Local result:Int = DirectFunction(SCI_GETEDGECOLUMN)
		Return result
	End Method
	
	Method Getedgemode:Int()
		Local result:Int = DirectFunction(SCI_GETEDGEMODE)
		Return result
	End Method
	
	Method Getendatlastline:Int()
		Local result:Int = DirectFunction(SCI_GETENDATLASTLINE)
		Return result
	End Method
	
	Method Getendstyled:Int()
		Local result:Int = DirectFunction(SCI_GETENDSTYLED)
		Return result
	End Method
	
	Method Geteolmode:Int()
		Local result:Int = DirectFunction(SCI_GETEOLMODE)
		Return result
	End Method
	
	Method Getextraascent:Int()
		Local result:Int = DirectFunction(SCI_GETEXTRAASCENT)
		Return result
	End Method
	
	Method Getextradescent:Int()
		Local result:Int = DirectFunction(SCI_GETEXTRADESCENT)
		Return result
	End Method
	
	Method Getfirstvisibleline:Int()
		Local result:Int = DirectFunction(SCI_GETFIRSTVISIBLELINE)
		Return result
	End Method
	
	Method Getfocus:Int()
		Local result:Int = DirectFunction(SCI_GETFOCUS)
		Return result
	End Method
	
	Method Getfoldexpanded:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETFOLDEXPANDED,line)
		Return result
	End Method
	
	Method Getfoldlevel:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETFOLDLEVEL,line)
		Return result
	End Method
	
	Method Getfoldparent:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETFOLDPARENT,line)
		Return result
	End Method
	
	Method Getfontquality:Int()
		Local result:Int = DirectFunction(SCI_GETFONTQUALITY)
		Return result
	End Method
	
	Method Getgapposition:Int()
		Local result:Int = DirectFunction(SCI_GETGAPPOSITION)
		Return result
	End Method
	
	Method Gethighlightguide:Int()
		Local result:Int = DirectFunction(SCI_GETHIGHLIGHTGUIDE)
		Return result
	End Method
	
	Method Gethotspotactiveback:Int()
		Local result:Int = DirectFunction(SCI_GETHOTSPOTACTIVEBACK)
		Return result
	End Method
	
	Method Gethotspotactivefore:Int()
		Local result:Int = DirectFunction(SCI_GETHOTSPOTACTIVEFORE)
		Return result
	End Method
	
	Method Gethotspotactiveunderline:Int()
		Local result:Int = DirectFunction(SCI_GETHOTSPOTACTIVEUNDERLINE)
		Return result
	End Method
	
	Method Gethotspotsingleline:Int()
		Local result:Int = DirectFunction(SCI_GETHOTSPOTSINGLELINE)
		Return result
	End Method
	
	Method Gethscrollbar:Int()
		Local result:Int = DirectFunction(SCI_GETHSCROLLBAR)
		Return result
	End Method
	
	Method Getidentifier:Int()
		Local result:Int = DirectFunction(SCI_GETIDENTIFIER)
		Return result
	End Method
	
	Method Getindent:Int()
		Local result:Int = DirectFunction(SCI_GETINDENT)
		Return result
	End Method
	
	Method Getindentationguides:Int()
		Local result:Int = DirectFunction(SCI_GETINDENTATIONGUIDES)
		Return result
	End Method
	
	Method Getkeysunicode:Int()
		Local result:Int = DirectFunction(SCI_GETKEYSUNICODE)
		Return result
	End Method
	
	Method Getlastchild:Int(line:Int,level:Int)
		Local result:Int = DirectFunction(SCI_GETLASTCHILD,line,level)
		Return result
	End Method
	
	Method Getlayoutcache:Int()
		Local result:Int = DirectFunction(SCI_GETLAYOUTCACHE)
		Return result
	End Method
	
	Method Getlength:Int()
		Local result:Int = DirectFunction(SCI_GETLENGTH)
		Return result
	End Method
	
	Method Getlexer:Int()
		Local result:Int = DirectFunction(SCI_GETLEXER)
		Return result
	End Method
	
	Method Getlexerlanguage:Int(Length:Int)
		Local chars:Byte[] = New Byte[Length]
		Local result:Int = DirectFunction(SCI_GETLEXERLANGUAGE,0,Int Byte Ptr(chars))
		Return result
	End Method
	
	Method getLine:String(Line:Int, Length:Int)
		Local chars:Byte[] = New Byte[Length]
		Local result:Int = DirectFunction(SCI_GETLINE,line,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Getlinecount:Int()
		Local result:Int = DirectFunction(SCI_GETLINECOUNT)
		Return result
	End Method
	
	Method Getlineendposition:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETLINEENDPOSITION,line)
		Return result
	End Method
	
	Method Getlineindentation:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETLINEINDENTATION,line)
		Return result
	End Method
	
	Method Getlineindentposition:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETLINEINDENTPOSITION,line)
		Return result
	End Method
	
	Method Getlineselendposition:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETLINESELENDPOSITION,line)
		Return result
	End Method
	
	Method Getlineselstartposition:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETLINESELSTARTPOSITION,line)
		Return result
	End Method
	
	Method Getlinestate:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETLINESTATE,line)
		Return result
	End Method
	
	Method Getlinevisible:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GETLINEVISIBLE,line)
		Return result
	End Method
	
	Method Getmainselection:Int()
		Local result:Int = DirectFunction(SCI_GETMAINSELECTION)
		Return result
	End Method
	
	Method Getmargincursorn:Int(margin:Int)
		Local result:Int = DirectFunction(SCI_GETMARGINCURSORN,margin)
		Return result
	End Method
	
	Method Getmarginleft:Int()
		Local result:Int = DirectFunction(SCI_GETMARGINLEFT)
		Return result
	End Method
	
	Method Getmarginmaskn:Int(margin:Int)
		Local result:Int = DirectFunction(SCI_GETMARGINMASKN,margin)
		Return result
	End Method
	
	Method Getmarginoptions:Int()
		Local result:Int = DirectFunction(SCI_GETMARGINOPTIONS)
		Return result
	End Method
	
	Method Getmarginright:Int()
		Local result:Int = DirectFunction(SCI_GETMARGINRIGHT)
		Return result
	End Method
	
	Method Getmarginsensitiven:Int(margin:Int)
		Local result:Int = DirectFunction(SCI_GETMARGINSENSITIVEN,margin)
		Return result
	End Method
	
	Method Getmargintypen:Int(margin:Int)
		Local result:Int = DirectFunction(SCI_GETMARGINTYPEN,margin)
		Return result
	End Method
	
	Method Getmarginwidthn:Int(margin:Int)
		Local result:Int = DirectFunction(SCI_GETMARGINWIDTHN,margin)
		Return result
	End Method
	
	Method Getmaxlinestate:Int()
		Local result:Int = DirectFunction(SCI_GETMAXLINESTATE)
		Return result
	End Method
	
	Method Getmodeventmask:Int()
		Local result:Int = DirectFunction(SCI_GETMODEVENTMASK)
		Return result
	End Method
	
	Method Getmodify:Int()
		Local result:Int = DirectFunction(SCI_GETMODIFY)
		Return result
	End Method
	
	Method Getmousedwelltime:Int()
		Local result:Int = DirectFunction(SCI_GETMOUSEDWELLTIME)
		Return result
	End Method
	
	Method Getmultipaste:Int()
		Local result:Int = DirectFunction(SCI_GETMULTIPASTE)
		Return result
	End Method
	
	Method Getmultipleselection:Int()
		Local result:Int = DirectFunction(SCI_GETMULTIPLESELECTION)
		Return result
	End Method
	
	Method Getpasteconvertendings:Int()
		Local result:Int = DirectFunction(SCI_GETPASTECONVERTENDINGS)
		Return result
	End Method
	
	Method Getpositioncache:Int()
		Local result:Int = DirectFunction(SCI_GETPOSITIONCACHE)
		Return result
	End Method
	
	Method Getprintcolourmode:Int()
		Local result:Int = DirectFunction(SCI_GETPRINTCOLOURMODE)
		Return result
	End Method
	
	Method Getprintmagnification:Int()
		Local result:Int = DirectFunction(SCI_GETPRINTMAGNIFICATION)
		Return result
	End Method
	
	Method Getprintwrapmode:Int()
		Local result:Int = DirectFunction(SCI_GETPRINTWRAPMODE)
		Return result
	End Method
	
	Method getProperty:String(key:String, Length:Int)
		Local key_ptr:Byte Ptr = key.toCString()
		Local chars:Byte[] = New Byte[length]
		Local Result:Int = DirectFunction(SCI_GETPROPERTY, Int(key_ptr), Int Byte Ptr(chars))
		MemFree(key_ptr)
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Getpropertyexpanded:String(key:String, Length:Int)
		Local key_ptr:Byte Ptr = key.toCString()
		Local chars:Byte[] = New Byte[length]
		Local Result:Int = DirectFunction(SCI_GETPROPERTYEXPANDED, Int(key_ptr), Int Byte Ptr(chars))
		MemFree(key_ptr)
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Getpropertyint:Int(key:String, _default:Int)
		Local key_ptr:Byte Ptr = key.toCString()
		Local Result:Int = DirectFunction(SCI_GETPROPERTYINT, Int(key_ptr), _default)
		MemFree(key_ptr)
		Return result
	End Method
	
	Method Getpunctuationchars:String(Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_GETPUNCTUATIONCHARS,0,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Getrangepointer:Int(position:Int,rangeLength:Int)
		Local result:Int = DirectFunction(SCI_GETRANGEPOINTER,position,rangeLength)
		Return result
	End Method
	
	Method Getreadonly:Int()
		Local result:Int = DirectFunction(SCI_GETREADONLY)
		Return result
	End Method
	
	Method Getrectangularselectionanchor:Int()
		Local result:Int = DirectFunction(SCI_GETRECTANGULARSELECTIONANCHOR)
		Return result
	End Method
	
	Method Getrectangularselectionanchorvirtualspace:Int()
		Local result:Int = DirectFunction(SCI_GETRECTANGULARSELECTIONANCHORVIRTUALSPACE)
		Return result
	End Method
	
	Method Getrectangularselectioncaret:Int()
		Local result:Int = DirectFunction(SCI_GETRECTANGULARSELECTIONCARET)
		Return result
	End Method
	
	Method Getrectangularselectioncaretvirtualspace:Int()
		Local result:Int = DirectFunction(SCI_GETRECTANGULARSELECTIONCARETVIRTUALSPACE)
		Return result
	End Method
	
	Method Getrectangularselectionmodifier:Int()
		Local result:Int = DirectFunction(SCI_GETRECTANGULARSELECTIONMODIFIER)
		Return result
	End Method
	
	Method Getscrollwidth:Int()
		Local result:Int = DirectFunction(SCI_GETSCROLLWIDTH)
		Return result
	End Method
	
	Method Getscrollwidthtracking:Int()
		Local result:Int = DirectFunction(SCI_GETSCROLLWIDTHTRACKING)
		Return result
	End Method
	
	Method Getsearchflags:Int()
		Local result:Int = DirectFunction(SCI_GETSEARCHFLAGS)
		Return result
	End Method
	
	Method Getselalpha:Int()
		Local result:Int = DirectFunction(SCI_GETSELALPHA)
		Return result
	End Method
	
	Method Getselectionend:Int()
		Local result:Int = DirectFunction(SCI_GETSELECTIONEND)
		Return result
	End Method
	
	Method Getselectionmode:Int()
		Local result:Int = DirectFunction(SCI_GETSELECTIONMODE)
		Return result
	End Method
	
	Method Getselectionnanchor:Int(selection:Int)
		Local result:Int = DirectFunction(SCI_GETSELECTIONNANCHOR,selection)
		Return result
	End Method
	
	Method Getselectionnanchorvirtualspace:Int(selection:Int)
		Local result:Int = DirectFunction(SCI_GETSELECTIONNANCHORVIRTUALSPACE,selection)
		Return result
	End Method
	
	Method Getselectionncaret:Int(selection:Int)
		Local result:Int = DirectFunction(SCI_GETSELECTIONNCARET,selection)
		Return result
	End Method
	
	Method Getselectionncaretvirtualspace:Int(selection:Int)
		Local result:Int = DirectFunction(SCI_GETSELECTIONNCARETVIRTUALSPACE,selection)
		Return result
	End Method
	
	Method Getselectionnend:Int(selection:Int)
		Local result:Int = DirectFunction(SCI_GETSELECTIONNEND,selection)
		Return result
	End Method
	
	Method Getselectionnstart:Int(selection:Int)
		Local result:Int = DirectFunction(SCI_GETSELECTIONNSTART,selection)
		Return result
	End Method
	
	Method Getselections:Int()
		Local result:Int = DirectFunction(SCI_GETSELECTIONS)
		Return result
	End Method
	
	Method Getselectionstart:Int()
		Local result:Int = DirectFunction(SCI_GETSELECTIONSTART)
		Return result
	End Method
	
	Method Getseleolfilled:Int()
		Local result:Int = DirectFunction(SCI_GETSELEOLFILLED)
		Return result
	End Method
	
	Method Getseltext:String(Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_GETSELTEXT,0,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Getstyleat:Int(position:Int)
		Local result:Int = DirectFunction(SCI_GETSTYLEAT,position)
		Return result
	End Method
	
	Method Getstylebits:Int()
		Local result:Int = DirectFunction(SCI_GETSTYLEBITS)
		Return result
	End Method
	
	Method Getstylebitsneeded:Int()
		Local result:Int = DirectFunction(SCI_GETSTYLEBITSNEEDED)
		Return result
	End Method
	
	Method Gettabindents:Int()
		Local result:Int = DirectFunction(SCI_GETTABINDENTS)
		Return result
	End Method
	
	Method Gettabwidth:Int()
		Local result:Int = DirectFunction(SCI_GETTABWIDTH)
		Return result
	End Method
	
	Method GetTag:String(tagNumber:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_GETTAG,tagNumber,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Gettargetend:Int()
		Local result:Int = DirectFunction(SCI_GETTARGETEND)
		Return result
	End Method
	
	Method Gettargetstart:Int()
		Local result:Int = DirectFunction(SCI_GETTARGETSTART)
		Return result
	End Method
	
	Method Gettechnology:Int()
		Local result:Int = DirectFunction(SCI_GETTECHNOLOGY)
		Return result
	End Method
	
	Method sciGettext:String(Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_GETTEXT,length,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Gettextlength:Int()
		Local result:Int = DirectFunction(SCI_GETTEXTLENGTH)
		Return result
	End Method
	
	Method Gettwophasedraw:Int()
		Local result:Int = DirectFunction(SCI_GETTWOPHASEDRAW)
		Return result
	End Method
	
	Method Getundocollection:Int()
		Local result:Int = DirectFunction(SCI_GETUNDOCOLLECTION)
		Return result
	End Method
	
	Method Getusepalette:Int()
		Local result:Int = DirectFunction(SCI_GETUSEPALETTE)
		Return result
	End Method
	
	Method Getusetabs:Int()
		Local result:Int = DirectFunction(SCI_GETUSETABS)
		Return result
	End Method
	
	Method Getvieweol:Int()
		Local result:Int = DirectFunction(SCI_GETVIEWEOL)
		Return result
	End Method
	
	Method Getviewws:Int()
		Local result:Int = DirectFunction(SCI_GETVIEWWS)
		Return result
	End Method
	
	Method Getvirtualspaceoptions:Int()
		Local result:Int = DirectFunction(SCI_GETVIRTUALSPACEOPTIONS)
		Return result
	End Method
	
	Method Getvscrollbar:Int()
		Local result:Int = DirectFunction(SCI_GETVSCROLLBAR)
		Return result
	End Method
	
	Method Getwhitespacechars:String(Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_GETWHITESPACECHARS,0,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Getwhitespacesize:Int()
		Local result:Int = DirectFunction(SCI_GETWHITESPACESIZE)
		Return result
	End Method
	
	Method Getwordchars:String(Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_GETWORDCHARS,0,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Getwrapindentmode:Int()
		Local result:Int = DirectFunction(SCI_GETWRAPINDENTMODE)
		Return result
	End Method
	
	Method Getwrapmode:Int()
		Local result:Int = DirectFunction(SCI_GETWRAPMODE)
		Return result
	End Method
	
	Method Getwrapstartindent:Int()
		Local result:Int = DirectFunction(SCI_GETWRAPSTARTINDENT)
		Return result
	End Method
	
	Method Getwrapvisualflags:Int()
		Local result:Int = DirectFunction(SCI_GETWRAPVISUALFLAGS)
		Return result
	End Method
	
	Method Getwrapvisualflagslocation:Int()
		Local result:Int = DirectFunction(SCI_GETWRAPVISUALFLAGSLOCATION)
		Return result
	End Method
	
	Method Getxoffset:Int()
		Local result:Int = DirectFunction(SCI_GETXOFFSET)
		Return result
	End Method
	
	Method Getzoom:Int()
		Local result:Int = DirectFunction(SCI_GETZOOM)
		Return result
	End Method
	
	Method Gotoline:Int(line:Int)
		Local result:Int = DirectFunction(SCI_GOTOLINE,line)
		Return result
	End Method
	
	Method Gotopos:Int(position:Int)
		Local result:Int = DirectFunction(SCI_GOTOPOS,position)
		Return result
	End Method
	
	Method Grabfocus:Int()
		Local result:Int = DirectFunction(SCI_GRABFOCUS)
		Return result
	End Method
	
	Method Hidelines:Int(lineStart:Int,lineEnd:Int)
		Local result:Int = DirectFunction(SCI_HIDELINES,lineStart,lineEnd)
		Return result
	End Method
	
	Method Hideselection:Int(hide:Int)
		Local result:Int = DirectFunction(SCI_HIDESELECTION,hide)
		Return result
	End Method
	
	Method Indicgetalpha:Int(indicatorNumber:Int)
		Local result:Int = DirectFunction(SCI_INDICGETALPHA,indicatorNumber)
		Return result
	End Method
	
	Method Indicgetfore:Int(indicatorNumber:Int)
		Local result:Int = DirectFunction(SCI_INDICGETFORE,indicatorNumber)
		Return result
	End Method
	
	Method Indicgetoutlinealpha:Int(indicatorNumber:Int)
		Local result:Int = DirectFunction(SCI_INDICGETOUTLINEALPHA,indicatorNumber)
		Return result
	End Method
	
	Method Indicgetstyle:Int(indicatorNumber:Int)
		Local result:Int = DirectFunction(SCI_INDICGETSTYLE,indicatorNumber)
		Return result
	End Method
	
	Method Indicgetunder:Int(indicatorNumber:Int)
		Local result:Int = DirectFunction(SCI_INDICGETUNDER,indicatorNumber)
		Return result
	End Method
	
	Method Indicsetalpha:Int(indicatorNumber:Int,alpha:Int)
		Local result:Int = DirectFunction(SCI_INDICSETALPHA,indicatorNumber,alpha)
		Return result
	End Method
	
	Method Indicsetfore:Int(indicatorNumber:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_INDICSETFORE,indicatorNumber,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Indicsetoutlinealpha:Int(indicatorNumber:Int,alpha:Int)
		Local result:Int = DirectFunction(SCI_INDICSETOUTLINEALPHA,indicatorNumber,alpha)
		Return result
	End Method
	
	Method Indicsetstyle:Int(indicatorNumber:Int,indicatorStyle:Int)
		Local result:Int = DirectFunction(SCI_INDICSETSTYLE,indicatorNumber,indicatorStyle)
		Return result
	End Method
	
	Method Indicsetunder:Int(indicatorNumber:Int,under:Int)
		Local result:Int = DirectFunction(SCI_INDICSETUNDER,indicatorNumber,under)
		Return result
	End Method
	
	Method Inserttext:Int(pos:Int,text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_INSERTTEXT, Pos, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Linefromposition:Int(position:Int)
		Local result:Int = DirectFunction(SCI_LINEFROMPOSITION,position)
		Return result
	End Method
	
	Method Linelength:Int(line:Int)
		Local result:Int = DirectFunction(SCI_LINELENGTH,line)
		Return result
	End Method
	
	Method Linescroll:Int(column:Int,line:Int)
		Local result:Int = DirectFunction(SCI_LINESCROLL,column,line)
		Return result
	End Method
	
	Method Linesjoin:Int()
		Local result:Int = DirectFunction(SCI_LINESJOIN)
		Return result
	End Method
	
	Method Linesonscreen:Int()
		Local result:Int = DirectFunction(SCI_LINESONSCREEN)
		Return result
	End Method
	
	Method Linessplit:Int(pixelWidth:Int)
		Local result:Int = DirectFunction(SCI_LINESSPLIT,pixelWidth)
		Return result
	End Method
	
	Method Loadlexerlibrary:Int(path:String)
		Local path_ptr:Byte Ptr = path.toCString()
		Local Result:Int = DirectFunction(SCI_LOADLEXERLIBRARY, 0, Int(path_ptr))
		MemFree(path_ptr)
		Return result
	End Method
	
	Method Margingetstyle:Int(line:Int)
		Local result:Int = DirectFunction(SCI_MARGINGETSTYLE,line)
		Return result
	End Method
	
	Method Margingetstyleoffset:Int()
		Local result:Int = DirectFunction(SCI_MARGINGETSTYLEOFFSET)
		Return result
	End Method
	
	Method Margingetstyles:String(Line:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_MARGINGETSTYLES,line,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Margingettext:String(Line:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_MARGINGETTEXT,line,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Marginsetstyle:Int(line:Int,style:Int)
		Local result:Int = DirectFunction(SCI_MARGINSETSTYLE,line,style)
		Return result
	End Method
	
	Method Marginsetstyleoffset:Int(style:Int)
		Local result:Int = DirectFunction(SCI_MARGINSETSTYLEOFFSET,style)
		Return result
	End Method
	
	Method Marginsetstyles:String(Line:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_MARGINSETSTYLES,line,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Marginsettext:String(Line:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_MARGINSETTEXT,line,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Margintextclearall:Int()
		Local result:Int = DirectFunction(SCI_MARGINTEXTCLEARALL)
		Return result
	End Method
	
	Method Markeradd:Int(line:Int,markerNumber:Int)
		Local result:Int = DirectFunction(SCI_MARKERADD,line,markerNumber)
		Return result
	End Method
	
	Method Markeraddset:Int(line:Int,markerMask:Int)
		Local result:Int = DirectFunction(SCI_MARKERADDSET,line,markerMask)
		Return result
	End Method
	
	Method Markerdefine:Int(markerNumber:Int,markerSymbols:Int)
		Local result:Int = DirectFunction(SCI_MARKERDEFINE,markerNumber,markerSymbols)
		Return result
	End Method
	
	Method Markerdefinepixmap:Int(markerNumber:Int,xpm:String)
		Local xpm_ptr:Byte Ptr = xpm.toCString()
		Local Result:Int = DirectFunction(SCI_MARKERDEFINEPIXMAP, markerNumber, Int(xpm_ptr))
		MemFree(xpm_ptr)
		Return result
	End Method
	
	Method Markerdefinergbaimage:Int(markerNumber:Int,pixels:String)
		Local pixels_ptr:Byte Ptr = pixels.toCString()
		Local Result:Int = DirectFunction(SCI_MARKERDEFINERGBAIMAGE, markerNumber, Int(pixels_ptr))
		MemFree(pixels_ptr)
		Return result
	End Method
	
	Method Markerdelete:Int(line:Int,markerNumber:Int)
		Local result:Int = DirectFunction(SCI_MARKERDELETE,line,markerNumber)
		Return result
	End Method
	
	Method Markerdeleteall:Int(markerNumber:Int)
		Local result:Int = DirectFunction(SCI_MARKERDELETEALL,markerNumber)
		Return result
	End Method
	
	Method Markerdeletehandle:Int(handle:Int)
		Local result:Int = DirectFunction(SCI_MARKERDELETEHANDLE,handle)
		Return result
	End Method
	
	Method Markerenablehighlight:Int(enabled:Int)
		Local result:Int = DirectFunction(SCI_MARKERENABLEHIGHLIGHT,enabled)
		Return result
	End Method
	
	Method Markerget:Int(line:Int)
		Local result:Int = DirectFunction(SCI_MARKERGET,line)
		Return result
	End Method
	
	Method Markerlinefromhandle:Int(handle:Int)
		Local result:Int = DirectFunction(SCI_MARKERLINEFROMHANDLE,handle)
		Return result
	End Method
	
	Method Markernext:Int(lineStart:Int,markerMask:Int)
		Local result:Int = DirectFunction(SCI_MARKERNEXT,lineStart,markerMask)
		Return result
	End Method
	
	Method Markerprevious:Int(lineStart:Int,markerMask:Int)
		Local result:Int = DirectFunction(SCI_MARKERPREVIOUS,lineStart,markerMask)
		Return result
	End Method
	
	Method Markersetalpha:Int(markerNumber:Int,alpha:Int)
		Local result:Int = DirectFunction(SCI_MARKERSETALPHA,markerNumber,alpha)
		Return result
	End Method
	
	Method Markersetback:Int(markerNumber:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_MARKERSETBACK,markerNumber,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Markersetbackselected:Int(markerNumber:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_MARKERSETBACKSELECTED,markerNumber,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Markersetfore:Int(markerNumber:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_MARKERSETFORE,markerNumber,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Markersymboldefined:Int(markerNumber:Int)
		Local result:Int = DirectFunction(SCI_MARKERSYMBOLDEFINED,markerNumber)
		Return result
	End Method
	
	Method Movecaretinsideview:Int()
		Local result:Int = DirectFunction(SCI_MOVECARETINSIDEVIEW)
		Return result
	End Method
	
	Method Moveselectedlinesdown:Int()
		Local result:Int = DirectFunction(SCI_MOVESELECTEDLINESDOWN)
		Return result
	End Method
	
	Method Moveselectedlinesup:Int()
		Local result:Int = DirectFunction(SCI_MOVESELECTEDLINESUP)
		Return result
	End Method
	
	Method sciNull:Int()
		Local result:Int = DirectFunction(SCI_NULL)
		Return result
	End Method
	
	Method Paste:Int()
		Local result:Int = DirectFunction(SCI_PASTE)
		Return result
	End Method
	
	Method Pointxfromposition:Int(position:Int)
		Local result:Int = DirectFunction(SCI_POINTXFROMPOSITION,0,position)
		Return result
	End Method
	
	Method Pointyfromposition:Int(position:Int)
		Local result:Int = DirectFunction(SCI_POINTYFROMPOSITION,0,position)
		Return result
	End Method
	
	Method Positionafter:Int(position:Int)
		Local result:Int = DirectFunction(SCI_POSITIONAFTER,position)
		Return result
	End Method
	
	Method Positionbefore:Int(position:Int)
		Local result:Int = DirectFunction(SCI_POSITIONBEFORE,position)
		Return result
	End Method
	
	Method Positionfromline:Int(line:Int)
		Local result:Int = DirectFunction(SCI_POSITIONFROMLINE,line)
		Return result
	End Method
	
	Method Positionfrompoint:Int(x:Int,y:Int)
		Local result:Int = DirectFunction(SCI_POSITIONFROMPOINT,x,y)
		Return result
	End Method
	
	Method Positionfrompointclose:Int(x:Int,y:Int)
		Local result:Int = DirectFunction(SCI_POSITIONFROMPOINTCLOSE,x,y)
		Return result
	End Method
	
	Method Propertynames:String(Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_PROPERTYNAMES,0,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Propertytype:Int(name:String)
		Local name_ptr:Byte Ptr = name.toCString()
		Local Result:Int = DirectFunction(SCI_PROPERTYTYPE, Int(name_ptr))
		MemFree(name_ptr)
		Return result
	End Method
	
	Method Redo:Int()
		Local result:Int = DirectFunction(SCI_REDO)
		Return result
	End Method
	
	Method Registerimage:Int(_type:Int, xpmData:String)
		Local xpmData_ptr:Byte Ptr = xpmData.toCString()
		Local Result:Int = DirectFunction(SCI_REGISTERIMAGE, _type, Int(xpmData_ptr))
		MemFree(xpmData_ptr)
		Return result
	End Method
	
	Method Registerrgbaimage:Int(_type:Int, Pixels:String)
		Local pixels_ptr:Byte Ptr = pixels.toCString()
		Local Result:Int = DirectFunction(SCI_REGISTERRGBAIMAGE, _type, Int(pixels_ptr))
		MemFree(pixels_ptr)
		Return result
	End Method
	
	Method ReplaceSel:Int(text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_REPLACESEL, 0, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Replacetarget:Int(length:Int,text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_REPLACETARGET, Length, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Replacetargetre:Int(length:Int,text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_REPLACETARGETRE, Length, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Rgbaimagesetheight:Int(height:Int)
		Local result:Int = DirectFunction(SCI_RGBAIMAGESETHEIGHT,height)
		Return result
	End Method
	
	Method Rgbaimagesetwidth:Int(width:Int)
		Local result:Int = DirectFunction(SCI_RGBAIMAGESETWIDTH,width)
		Return result
	End Method
	
	Method Rotateselection:Int()
		Local result:Int = DirectFunction(SCI_ROTATESELECTION)
		Return result
	End Method
	
	Method Scrollcaret:Int()
		Local result:Int = DirectFunction(SCI_SCROLLCARET)
		Return result
	End Method
	
	Method Searchanchor:Int()
		Local result:Int = DirectFunction(SCI_SEARCHANCHOR)
		Return result
	End Method
	
	Method Searchintarget:Int(length:Int,text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_SEARCHINTARGET, Length, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Searchnext:Int(searchFlags:Int,text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_SEARCHNEXT, searchFlags, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Searchprev:Int(searchFlags:Int,text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_SEARCHPREV, searchFlags, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Selectall:Int()
		Local result:Int = DirectFunction(SCI_SELECTALL)
		Return result
	End Method
	
	Method Selectionisrectangle:Int()
		Local result:Int = DirectFunction(SCI_SELECTIONISRECTANGLE)
		Return result
	End Method
	
	Method Setadditionalcaretfore:Int(r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETADDITIONALCARETFORE,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setadditionalcaretsblink:Int(additionalCaretsBlink:Int)
		Local result:Int = DirectFunction(SCI_SETADDITIONALCARETSBLINK,additionalCaretsBlink)
		Return result
	End Method
	
	Method Setadditionalcaretsvisible:Int(additionalCaretsVisible:Int)
		Local result:Int = DirectFunction(SCI_SETADDITIONALCARETSVISIBLE,additionalCaretsVisible)
		Return result
	End Method
	
	Method Setadditionalselalpha:Int(alpha:Int)
		Local result:Int = DirectFunction(SCI_SETADDITIONALSELALPHA,alpha)
		Return result
	End Method
	
	Method Setadditionalselback:Int(r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETADDITIONALSELBACK,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setadditionalselectiontyping:Int(additionalSelectionTyping:Int)
		Local result:Int = DirectFunction(SCI_SETADDITIONALSELECTIONTYPING,additionalSelectionTyping)
		Return result
	End Method
	
	Method Setadditionalselfore:Int(r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETADDITIONALSELFORE,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setanchor:Int(position:Int)
		Local result:Int = DirectFunction(SCI_SETANCHOR,position)
		Return result
	End Method
	
	Method Setbackspaceunindents:Int(bsUnIndents:Int)
		Local result:Int = DirectFunction(SCI_SETBACKSPACEUNINDENTS,bsUnIndents)
		Return result
	End Method
	
	Method Setbuffereddraw:Int(isBuffered:Int)
		Local result:Int = DirectFunction(SCI_SETBUFFEREDDRAW,isBuffered)
		Return result
	End Method
	
	Method Setcaretfore:Int(r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETCARETFORE,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setcaretlineback:Int(r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETCARETLINEBACK,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setcaretlinebackalpha:Int(alpha:Int)
		Local result:Int = DirectFunction(SCI_SETCARETLINEBACKALPHA,alpha)
		Return result
	End Method
	
	Method Setcaretlinevisible:Int(show:Int)
		Local result:Int = DirectFunction(SCI_SETCARETLINEVISIBLE,show)
		Return result
	End Method
	
	Method Setcaretperiod:Int(milliseconds:Int)
		Local result:Int = DirectFunction(SCI_SETCARETPERIOD,milliseconds)
		Return result
	End Method
	
	Method Setcaretsticky:Int(useCaretStickyBehaviour:Int)
		Local result:Int = DirectFunction(SCI_SETCARETSTICKY,useCaretStickyBehaviour)
		Return result
	End Method
	
	Method Setcaretstyle:Int(style:Int)
		Local result:Int = DirectFunction(SCI_SETCARETSTYLE,style)
		Return result
	End Method
	
	Method Setcaretwidth:Int(pixels:Int)
		Local result:Int = DirectFunction(SCI_SETCARETWIDTH,pixels)
		Return result
	End Method
	
	Method Setcharsdefault:Int()
		Local result:Int = DirectFunction(SCI_SETCHARSDEFAULT)
		Return result
	End Method
	
	Method Setcodepage:Int(codePage:Int)
		Local result:Int = DirectFunction(SCI_SETCODEPAGE,codePage)
		Return result
	End Method
	
	Method Setcontrolcharsymbol:Int(symbol:Int)
		Local result:Int = DirectFunction(SCI_SETCONTROLCHARSYMBOL,symbol)
		Return result
	End Method
	
	Method Setcurrentpos:Int(position:Int)
		Local result:Int = DirectFunction(SCI_SETCURRENTPOS,position)
		Return result
	End Method
	
	Method Setedgecolour:Int(r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETEDGECOLOUR,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setedgecolumn:Int(column:Int)
		Local result:Int = DirectFunction(SCI_SETEDGECOLUMN,column)
		Return result
	End Method
	
	Method Setedgemode:Int(mode:Int)
		Local result:Int = DirectFunction(SCI_SETEDGEMODE,mode)
		Return result
	End Method
	
	Method Setemptyselection:Int(pos:Int)
		Local result:Int = DirectFunction(SCI_SETEMPTYSELECTION,pos)
		Return result
	End Method
	
	Method Setendatlastline:Int(endAtLastLine:Int)
		Local result:Int = DirectFunction(SCI_SETENDATLASTLINE,endAtLastLine)
		Return result
	End Method
	
	Method Seteolmode:Int(eolMode:Int)
		Local result:Int = DirectFunction(SCI_SETEOLMODE,eolMode)
		Return result
	End Method
	
	Method Setextraascent:Int(extraAscent:Int)
		Local result:Int = DirectFunction(SCI_SETEXTRAASCENT,extraAscent)
		Return result
	End Method
	
	Method Setextradescent:Int(extraDescent:Int)
		Local result:Int = DirectFunction(SCI_SETEXTRADESCENT,extraDescent)
		Return result
	End Method
	
	Method Setfirstvisibleline:Int(lineDisplay:Int)
		Local result:Int = DirectFunction(SCI_SETFIRSTVISIBLELINE,lineDisplay)
		Return result
	End Method
	
	Method Setfocus:Int(focus:Int)
		Local result:Int = DirectFunction(SCI_SETFOCUS,focus)
		Return result
	End Method
	
	Method Setfoldexpanded:Int(line:Int,expanded:Int)
		Local result:Int = DirectFunction(SCI_SETFOLDEXPANDED,line,expanded)
		Return result
	End Method
	
	Method Setfoldflags:Int(flags:Int)
		Local result:Int = DirectFunction(SCI_SETFOLDFLAGS,flags)
		Return result
	End Method
	
	Method Setfoldlevel:Int(line:Int,level:Int)
		Local result:Int = DirectFunction(SCI_SETFOLDLEVEL,line,level)
		Return result
	End Method
	
	Method Setfoldmargincolour:Int(useSetting:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETFOLDMARGINCOLOUR,useSetting,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setfoldmarginhicolour:Int(useSetting:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETFOLDMARGINHICOLOUR,useSetting,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setfontquality:Int(fontQuality:Int)
		Local result:Int = DirectFunction(SCI_SETFONTQUALITY,fontQuality)
		Return result
	End Method
	
	Method Sethighlightguide:Int(column:Int)
		Local result:Int = DirectFunction(SCI_SETHIGHLIGHTGUIDE,column)
		Return result
	End Method
	
	Method Sethotspotactiveback:Int(useSetting:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETHOTSPOTACTIVEBACK,useSetting,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Sethotspotactivefore:Int(useSetting:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETHOTSPOTACTIVEFORE,useSetting,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Sethotspotactiveunderline:Int(underline:Int)
		Local result:Int = DirectFunction(SCI_SETHOTSPOTACTIVEUNDERLINE,underline)
		Return result
	End Method
	
	Method Sethotspotsingleline:Int(singleLine:Int)
		Local result:Int = DirectFunction(SCI_SETHOTSPOTSINGLELINE,singleLine)
		Return result
	End Method
	
	Method Sethscrollbar:Int(visible:Int)
		Local result:Int = DirectFunction(SCI_SETHSCROLLBAR,visible)
		Return result
	End Method
	
	Method Setidentifier:Int(identifier:Int)
		Local result:Int = DirectFunction(SCI_SETIDENTIFIER,identifier)
		Return result
	End Method
	
	Method Setindent:Int(widthInChars:Int)
		Local result:Int = DirectFunction(SCI_SETINDENT,widthInChars)
		Return result
	End Method
	
	Method Setindentationguides:Int(indentView:Int)
		Local result:Int = DirectFunction(SCI_SETINDENTATIONGUIDES,indentView)
		Return result
	End Method
	
	Method Setkeysunicode:Int(keysUnicode:Int)
		Local result:Int = DirectFunction(SCI_SETKEYSUNICODE,keysUnicode)
		Return result
	End Method
	
	Method Setkeywords:Int(keyWordSet:Int,keyWordList:String)
		Local keyWordList_ptr:Byte Ptr = keyWordList.toCString()
		Local Result:Int = DirectFunction(SCI_SETKEYWORDS, keyWordSet, Int(keyWordList_ptr))
		MemFree(keyWordList_ptr)
		Return result
	End Method
	
	Method Setlayoutcache:Int(cacheMode:Int)
		Local result:Int = DirectFunction(SCI_SETLAYOUTCACHE,cacheMode)
		Return result
	End Method
	
	Method Setlengthforencode:Int(bytes:Int)
		Local result:Int = DirectFunction(SCI_SETLENGTHFORENCODE,bytes)
		Return result
	End Method
	
	Method Setlexer:Int(lexer:Int)
		Local result:Int = DirectFunction(SCI_SETLEXER,lexer)
		Return result
	End Method
	
	Method Setlexerlanguage:Int(name:String)
		Local name_ptr:Byte Ptr = name.toCString()
		Local Result:Int = DirectFunction(SCI_SETLEXERLANGUAGE, 0, Int(name_ptr))
		MemFree(name_ptr)
		Return result
	End Method
	
	Method Setlineindentation:Int(line:Int,indentation:Int)
		Local result:Int = DirectFunction(SCI_SETLINEINDENTATION,line,indentation)
		Return result
	End Method
	
	Method Setlinestate:Int(line:Int,value:Int)
		Local result:Int = DirectFunction(SCI_SETLINESTATE,line,value)
		Return result
	End Method
	
	Method Setmainselection:Int(selection:Int)
		Local result:Int = DirectFunction(SCI_SETMAINSELECTION,selection)
		Return result
	End Method
	
	Method Setmargincursorn:Int(margin:Int,cursor:Int)
		Local result:Int = DirectFunction(SCI_SETMARGINCURSORN,margin,cursor)
		Return result
	End Method
	
	Method Setmarginleft:Int(pixels:Int)
		Local result:Int = DirectFunction(SCI_SETMARGINLEFT,0,pixels)
		Return result
	End Method
	
	Method Setmarginmaskn:Int(margin:Int,mask:Int)
		Local result:Int = DirectFunction(SCI_SETMARGINMASKN,margin,mask)
		Return result
	End Method
	
	Method Setmarginoptions:Int(marginOptions:Int)
		Local result:Int = DirectFunction(SCI_SETMARGINOPTIONS,marginOptions)
		Return result
	End Method
	
	Method Setmarginright:Int(pixels:Int)
		Local result:Int = DirectFunction(SCI_SETMARGINRIGHT,0,pixels)
		Return result
	End Method
	
	Method Setmarginsensitiven:Int(margin:Int,sensitive:Int)
		Local result:Int = DirectFunction(SCI_SETMARGINSENSITIVEN,margin,sensitive)
		Return result
	End Method
	
	Method SetMarginTypen:Int(margin:Int, _type:Int)
		Local Result:Int = DirectFunction(SCI_SETMARGINTYPEN, margin, _type)
		Return result
	End Method
	
	Method Setmarginwidthn:Int(margin:Int,pixelWidth:Int)
		Local result:Int = DirectFunction(SCI_SETMARGINWIDTHN,margin,pixelWidth)
		Return result
	End Method
	
	Method Setmodeventmask:Int(eventMask:Int)
		Local result:Int = DirectFunction(SCI_SETMODEVENTMASK,eventMask)
		Return result
	End Method
	
	Method Setmousedwelltime:Int(milliseconds:Int)
		Local result:Int = DirectFunction(SCI_SETMOUSEDWELLTIME,milliseconds)
		Return result
	End Method
	
	Method Setmultipaste:Int(multiPaste:Int)
		Local result:Int = DirectFunction(SCI_SETMULTIPASTE,multiPaste)
		Return result
	End Method
	
	Method Setmultipleselection:Int(multipleSelection:Int)
		Local result:Int = DirectFunction(SCI_SETMULTIPLESELECTION,multipleSelection)
		Return result
	End Method
	
	Method Setpasteconvertendings:Int(convert:Int)
		Local result:Int = DirectFunction(SCI_SETPASTECONVERTENDINGS,convert)
		Return result
	End Method
	
	Method Setpositioncache:Int(size:Int)
		Local result:Int = DirectFunction(SCI_SETPOSITIONCACHE,size)
		Return result
	End Method
	
	Method Setprintcolourmode:Int(mode:Int)
		Local result:Int = DirectFunction(SCI_SETPRINTCOLOURMODE,mode)
		Return result
	End Method
	
	Method Setprintmagnification:Int(magnification:Int)
		Local result:Int = DirectFunction(SCI_SETPRINTMAGNIFICATION,magnification)
		Return result
	End Method
	
	Method Setprintwrapmode:Int()
		Local result:Int = DirectFunction(SCI_SETPRINTWRAPMODE)
		Return result
	End Method
	
	Method Setproperty:Int(key:String,value:String)
		Local key_ptr:Byte Ptr = key.toCString()
		Local value_ptr:Byte Ptr = value.toCString()
		Local Result:Int = DirectFunction(SCI_SETPROPERTY, Int(key_ptr), Int(value_ptr))
		MemFree(key_ptr)
		MemFree(value_ptr)
		Return result
	End Method
	
	Method Setpunctuationchars:Int(characters:String)
		Local characters_ptr:Byte Ptr = characters.toCString()
		Local Result:Int = DirectFunction(SCI_SETPUNCTUATIONCHARS, 0, Int(characters_ptr))
		MemFree(characters_ptr)
		Return result
	End Method
	
	Method Setreadonly:Int(readOnly:Int)
		Local result:Int = DirectFunction(SCI_SETREADONLY,readOnly)
		Return result
	End Method
	
	Method Setrectangularselectionanchor:Int(posAnchor:Int)
		Local result:Int = DirectFunction(SCI_SETRECTANGULARSELECTIONANCHOR,posAnchor)
		Return result
	End Method
	
	Method Setrectangularselectionanchorvirtualspace:Int(space:Int)
		Local result:Int = DirectFunction(SCI_SETRECTANGULARSELECTIONANCHORVIRTUALSPACE,space)
		Return result
	End Method
	
	Method Setrectangularselectioncaret:Int(pos:Int)
		Local result:Int = DirectFunction(SCI_SETRECTANGULARSELECTIONCARET,pos)
		Return result
	End Method
	
	Method Setrectangularselectioncaretvirtualspace:Int(space:Int)
		Local result:Int = DirectFunction(SCI_SETRECTANGULARSELECTIONCARETVIRTUALSPACE,space)
		Return result
	End Method
	
	Method Setrectangularselectionmodifier:Int(modifier:Int)
		Local result:Int = DirectFunction(SCI_SETRECTANGULARSELECTIONMODIFIER,modifier)
		Return result
	End Method
	
	Method Setsavepoint:Int()
		Local result:Int = DirectFunction(SCI_SETSAVEPOINT)
		Return result
	End Method
	
	Method Setscrollwidth:Int(pixelWidth:Int)
		Local result:Int = DirectFunction(SCI_SETSCROLLWIDTH,pixelWidth)
		Return result
	End Method
	
	Method Setscrollwidthtracking:Int(tracking:Int)
		Local result:Int = DirectFunction(SCI_SETSCROLLWIDTHTRACKING,tracking)
		Return result
	End Method
	
	Method Setsearchflags:Int(searchFlags:Int)
		Local result:Int = DirectFunction(SCI_SETSEARCHFLAGS,searchFlags)
		Return result
	End Method
	
	Method Setsel:Int(anchorPos:Int,currentPos:Int)
		Local result:Int = DirectFunction(SCI_SETSEL,anchorPos,currentPos)
		Return result
	End Method
	
	Method Setselalpha:Int(alpha:Int)
		Local result:Int = DirectFunction(SCI_SETSELALPHA,alpha)
		Return result
	End Method
	
	Method Setselback:Int(useSelectionBackColour:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETSELBACK,useSelectionBackColour,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method sciSetselection:Int(caret:Int, anchor:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTION,caret,anchor)
		Return result
	End Method
	
	Method Setselectionend:Int(position:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTIONEND,position)
		Return result
	End Method
	
	Method Setselectionmode:Int(mode:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTIONMODE,mode)
		Return result
	End Method
	
	Method Setselectionnanchor:Int(selection:Int,posAnchor:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTIONNANCHOR,selection,posAnchor)
		Return result
	End Method
	
	Method Setselectionnanchorvirtualspace:Int(selection:Int,space:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTIONNANCHORVIRTUALSPACE,selection,space)
		Return result
	End Method
	
	Method Setselectionncaret:Int(selection:Int,pos:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTIONNCARET,selection,pos)
		Return result
	End Method
	
	Method Setselectionncaretvirtualspace:Int(selection:Int,space:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTIONNCARETVIRTUALSPACE,selection,space)
		Return result
	End Method
	
	Method Setselectionnend:Int(selection:Int,pos:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTIONNEND,selection,pos)
		Return result
	End Method
	
	Method Setselectionnstart:Int(selection:Int,pos:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTIONNSTART,selection,pos)
		Return result
	End Method
	
	Method Setselectionstart:Int(position:Int)
		Local result:Int = DirectFunction(SCI_SETSELECTIONSTART,position)
		Return result
	End Method
	
	Method Setseleolfilled:Int(filled:Int)
		Local result:Int = DirectFunction(SCI_SETSELEOLFILLED,filled)
		Return result
	End Method
	
	Method Setselfore:Int(useSelectionForeColour:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETSELFORE,useSelectionForeColour,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setstylebits:Int(bits:Int)
		Local result:Int = DirectFunction(SCI_SETSTYLEBITS,bits)
		Return result
	End Method
	
	Method Setstyling:Int(length:Int,style:Int)
		Local result:Int = DirectFunction(SCI_SETSTYLING,length,style)
		Return result
	End Method
	
	Method Setstylingex:Int(length:Int,styles:String)
		Local styles_ptr:Byte Ptr = styles.toCString()
		Local Result:Int = DirectFunction(SCI_SETSTYLINGEX, Length, Int(styles_ptr))
		MemFree(styles_ptr)
		Return result
	End Method
	
	Method Settabindents:Int(tabIndents:Int)
		Local result:Int = DirectFunction(SCI_SETTABINDENTS,tabIndents)
		Return result
	End Method
	
	Method Settabwidth:Int(widthInChars:Int)
		Local result:Int = DirectFunction(SCI_SETTABWIDTH,widthInChars)
		Return result
	End Method
	
	Method Settargetend:Int(pos:Int)
		Local result:Int = DirectFunction(SCI_SETTARGETEND,pos)
		Return result
	End Method
	
	Method Settargetstart:Int(pos:Int)
		Local result:Int = DirectFunction(SCI_SETTARGETSTART,pos)
		Return result
	End Method
	
	Method Settechnology:Int(technology:Int)
		Local result:Int = DirectFunction(SCI_SETTECHNOLOGY,technology)
		Return result
	End Method
	
	Method sciSettext:Int(text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_SETTEXT, 0, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Settwophasedraw:Int(twoPhase:Int)
		Local result:Int = DirectFunction(SCI_SETTWOPHASEDRAW,twoPhase)
		Return result
	End Method
	
	Method Setundocollection:Int(collectUndo:Int)
		Local result:Int = DirectFunction(SCI_SETUNDOCOLLECTION,collectUndo)
		Return result
	End Method
	
	Method Setusepalette:Int(allowPaletteUse:Int)
		Local result:Int = DirectFunction(SCI_SETUSEPALETTE,allowPaletteUse)
		Return result
	End Method
	
	Method Setusetabs:Int(useTabs:Int)
		Local result:Int = DirectFunction(SCI_SETUSETABS,useTabs)
		Return result
	End Method
	
	Method Setvieweol:Int(visible:Int)
		Local result:Int = DirectFunction(SCI_SETVIEWEOL,visible)
		Return result
	End Method
	
	Method Setviewws:Int(wsMode:Int)
		Local result:Int = DirectFunction(SCI_SETVIEWWS,wsMode)
		Return result
	End Method
	
	Method Setvirtualspaceoptions:Int(virtualSpaceOptions:Int)
		Local result:Int = DirectFunction(SCI_SETVIRTUALSPACEOPTIONS,virtualSpaceOptions)
		Return result
	End Method
	
	Method Setvisiblepolicy:Int(caretPolicy:Int,caretSlop:Int)
		Local result:Int = DirectFunction(SCI_SETVISIBLEPOLICY,caretPolicy,caretSlop)
		Return result
	End Method
	
	Method Setvscrollbar:Int(visible:Int)
		Local result:Int = DirectFunction(SCI_SETVSCROLLBAR,visible)
		Return result
	End Method
	
	Method Setwhitespaceback:Int(useWhitespaceBackColour:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETWHITESPACEBACK,useWhitespaceBackColour,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setwhitespacechars:Int(characters:String)
		Local characters_ptr:Byte Ptr = characters.toCString()
		Local Result:Int = DirectFunction(SCI_SETWHITESPACECHARS, 0, Int(characters_ptr))
		MemFree(characters_ptr)
		Return result
	End Method
	
	Method Setwhitespacefore:Int(useWhitespaceForeColour:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_SETWHITESPACEFORE,useWhitespaceForeColour,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Setwhitespacesize:Int(size:Int)
		Local result:Int = DirectFunction(SCI_SETWHITESPACESIZE,size)
		Return result
	End Method
	
	Method Setwordchars:Int(characters:String)
		Local characters_ptr:Byte Ptr = characters.toCString()
		Local Result:Int = DirectFunction(SCI_SETWORDCHARS, 0, Int(characters_ptr))
		MemFree(characters_ptr)
		Return result
	End Method
	
	Method Setwrapindentmode:Int(indentMode:Int)
		Local result:Int = DirectFunction(SCI_SETWRAPINDENTMODE,indentMode)
		Return result
	End Method
	
	Method Setwrapmode:Int(wrapMode:Int)
		Local result:Int = DirectFunction(SCI_SETWRAPMODE,wrapMode)
		Return result
	End Method
	
	Method Setwrapstartindent:Int(indent:Int)
		Local result:Int = DirectFunction(SCI_SETWRAPSTARTINDENT,indent)
		Return result
	End Method
	
	Method Setwrapvisualflags:Int(wrapVisualFlags:Int)
		Local result:Int = DirectFunction(SCI_SETWRAPVISUALFLAGS,wrapVisualFlags)
		Return result
	End Method
	
	Method Setwrapvisualflagslocation:Int(wrapVisualFlagsLocation:Int)
		Local result:Int = DirectFunction(SCI_SETWRAPVISUALFLAGSLOCATION,wrapVisualFlagsLocation)
		Return result
	End Method
	
	Method Setxcaretpolicy:Int(caretPolicy:Int,caretSlop:Int)
		Local result:Int = DirectFunction(SCI_SETXCARETPOLICY,caretPolicy,caretSlop)
		Return result
	End Method
	
	Method Setxoffset:Int(xOffset:Int)
		Local result:Int = DirectFunction(SCI_SETXOFFSET,xOffset)
		Return result
	End Method
	
	Method Setycaretpolicy:Int(caretPolicy:Int,caretSlop:Int)
		Local result:Int = DirectFunction(SCI_SETYCARETPOLICY,caretPolicy,caretSlop)
		Return result
	End Method
	
	Method Setzoom:Int(zoomInPoints:Int)
		Local result:Int = DirectFunction(SCI_SETZOOM,zoomInPoints)
		Return result
	End Method
	
	Method Showlines:Int(lineStart:Int,lineEnd:Int)
		Local result:Int = DirectFunction(SCI_SHOWLINES,lineStart,lineEnd)
		Return result
	End Method
	
	Method Startstyling:Int(position:Int,mask:Int)
		Local result:Int = DirectFunction(SCI_STARTSTYLING,position,mask)
		Return result
	End Method
	
	Method Styleclearall:Int()
		Local result:Int = DirectFunction(SCI_STYLECLEARALL)
		Return result
	End Method
	
	Method Stylegetback:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETBACK,styleNumber)
		Return result
	End Method
	
	Method Stylegetbold:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETBOLD,styleNumber)
		Return result
	End Method
	
	Method Stylegetcase:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETCASE,styleNumber)
		Return result
	End Method
	
	Method Stylegetchangeable:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETCHANGEABLE,styleNumber)
		Return result
	End Method
	
	Method Stylegetcharacterset:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETCHARACTERSET,styleNumber)
		Return result
	End Method
	
	Method Stylegeteolfilled:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETEOLFILLED,styleNumber)
		Return result
	End Method
	
	Method StyleGetFont:String(styleNumber:Int, Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_STYLEGETFONT,styleNumber,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Stylegetfore:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETFORE,styleNumber)
		Return result
	End Method
	
	Method Stylegethotspot:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETHOTSPOT,styleNumber)
		Return result
	End Method
	
	Method Stylegetitalic:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETITALIC,styleNumber)
		Return result
	End Method
	
	Method Stylegetsize:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETSIZE,styleNumber)
		Return result
	End Method
	
	Method Stylegetsizefractional:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETSIZEFRACTIONAL,styleNumber)
		Return result
	End Method
	
	Method Stylegetunderline:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETUNDERLINE,styleNumber)
		Return result
	End Method
	
	Method Stylegetvisible:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETVISIBLE,styleNumber)
		Return result
	End Method
	
	Method Stylegetweight:Int(styleNumber:Int)
		Local result:Int = DirectFunction(SCI_STYLEGETWEIGHT,styleNumber)
		Return result
	End Method
	
	Method Styleresetdefault:Int()
		Local result:Int = DirectFunction(SCI_STYLERESETDEFAULT)
		Return result
	End Method
	
	Method Stylesetback:Int(styleNumber:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_STYLESETBACK,styleNumber,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Stylesetbold:Int(styleNumber:Int,bold:Int)
		Local result:Int = DirectFunction(SCI_STYLESETBOLD,styleNumber,bold)
		Return result
	End Method
	
	Method Stylesetcase:Int(styleNumber:Int,caseMode:Int)
		Local result:Int = DirectFunction(SCI_STYLESETCASE,styleNumber,caseMode)
		Return result
	End Method
	
	Method Stylesetchangeable:Int(styleNumber:Int,changeable:Int)
		Local result:Int = DirectFunction(SCI_STYLESETCHANGEABLE,styleNumber,changeable)
		Return result
	End Method
	
	Method Stylesetcharacterset:Int(styleNumber:Int,charSet:Int)
		Local result:Int = DirectFunction(SCI_STYLESETCHARACTERSET,styleNumber,charSet)
		Return result
	End Method
	
	Method Styleseteolfilled:Int(styleNumber:Int,eolFilled:Int)
		Local result:Int = DirectFunction(SCI_STYLESETEOLFILLED,styleNumber,eolFilled)
		Return result
	End Method
	
	Method StyleSetFont:Int(styleNumber:Int, s:String)
		Local s_ptr:Byte Ptr = s.toCString()
		Local Result:Int = DirectFunction(SCI_STYLESETFONT, styleNumber, Int(s_ptr))
		MemFree(s_ptr)
		Return Result
	End Method
	
	Method Stylesetfore:Int(styleNumber:Int,r:Int,g:Int,b:Int)
		Local result:Int = DirectFunction(SCI_STYLESETFORE,styleNumber,EncodeColor(r,g,b))
		Return result
	End Method
	
	Method Stylesethotspot:Int(styleNumber:Int,hotspot:Int)
		Local result:Int = DirectFunction(SCI_STYLESETHOTSPOT,styleNumber,hotspot)
		Return result
	End Method
	
	Method Stylesetitalic:Int(styleNumber:Int,italic:Int)
		Local result:Int = DirectFunction(SCI_STYLESETITALIC,styleNumber,italic)
		Return result
	End Method
	
	Method Stylesetsize:Int(styleNumber:Int,sizeInPos:Int)
		Local result:Int = DirectFunction(SCI_STYLESETSIZE,styleNumber,sizeInPos)
		Return result
	End Method
	
	Method Stylesetsizefractional:Int(styleNumber:Int,sizeInHundredthPos:Int)
		Local result:Int = DirectFunction(SCI_STYLESETSIZEFRACTIONAL,styleNumber,sizeInHundredthPos)
		Return result
	End Method
	
	Method Stylesetunderline:Int(styleNumber:Int,underline:Int)
		Local result:Int = DirectFunction(SCI_STYLESETUNDERLINE,styleNumber,underline)
		Return result
	End Method
	
	Method Stylesetvisible:Int(styleNumber:Int,visible:Int)
		Local result:Int = DirectFunction(SCI_STYLESETVISIBLE,styleNumber,visible)
		Return result
	End Method
	
	Method Stylesetweight:Int(styleNumber:Int,weight:Int)
		Local result:Int = DirectFunction(SCI_STYLESETWEIGHT,styleNumber,weight)
		Return result
	End Method
	
	Method Swapmainanchorcaret:Int()
		Local result:Int = DirectFunction(SCI_SWAPMAINANCHORCARET)
		Return result
	End Method
	
	Method Targetasutf8:String(Length:Int)
		Local chars:Byte[] = New Byte[length]
		Local result:Int = DirectFunction(SCI_TARGETASUTF8,0,Int Byte Ptr(chars))
		Return String.FromCString(Byte Ptr(chars))
	End Method
	
	Method Targetfromselection:Int()
		Local result:Int = DirectFunction(SCI_TARGETFROMSELECTION)
		Return result
	End Method
	
	Method TextHeight:Int(line:Int)
		Local result:Int = DirectFunction(SCI_TEXTHEIGHT,line)
		Return result
	End Method
	
	Method TextWidth:Int(styleNumber:Int,text:String)
		Local text_ptr:Byte Ptr = text.toCString()
		Local Result:Int = DirectFunction(SCI_TEXTWIDTH, styleNumber, Int(text_ptr))
		MemFree(text_ptr)
		Return result
	End Method
	
	Method Togglecaretsticky:Int()
		Local result:Int = DirectFunction(SCI_TOGGLECARETSTICKY)
		Return result
	End Method
	
	Method Togglefold:Int(line:Int)
		Local result:Int = DirectFunction(SCI_TOGGLEFOLD,line)
		Return result
	End Method
	
	Method Undo:Int()
		Local result:Int = DirectFunction(SCI_UNDO)
		Return result
	End Method
	
	Method Visiblefromdocline:Int(docLine:Int)
		Local result:Int = DirectFunction(SCI_VISIBLEFROMDOCLINE,docLine)
		Return result
	End Method
	
	Method Wordendposition:Int(position:Int,onlyWordCharacters:Int)
		Local result:Int = DirectFunction(SCI_WORDENDPOSITION,position,onlyWordCharacters)
		Return result
	End Method
	
	Method Wordstartposition:Int(position:Int,onlyWordCharacters:Int)
		Local result:Int = DirectFunction(SCI_WORDSTARTPOSITION,position,onlyWordCharacters)
		Return result
	End Method
	
	Method Wrapcount:Int(docLine:Int)
		Local result:Int = DirectFunction(SCI_WRAPCOUNT,docLine)
		Return result
	End Method
	
	Method Zoomin:Int()
		Local result:Int = DirectFunction(SCI_ZOOMIN)
		Return result
	End Method
	
	Method Zoomout:Int()
		Local result:Int = DirectFunction(SCI_ZOOMOUT)
		Return result
	End Method
	
	Method Usepopup:Int(use:Int = 0)
		return DirectFunction(SCI_USEPOPUP, use)
	End Method
	'#endregion
	
End Type

Function CreateScintillaTextArea:TScintillaTextArea(X:Int, Y:Int, w:Int, h:Int, parent:TGadget)
	Return TScintillaTextArea.Create(X, Y, w, h, parent)
End Function
